package com.fsserver.core.service;

import com.fsserver.core.dto.PaymentOrderDTO;
import com.fsserver.core.entity.PaymentOrder;

import java.util.List;

/**
 * 支付订单服务接口
 * Payment Order Service
 *
 * @author fsserver
 */
public interface PaymentOrderService {

    /**
     * 创建支付订单
     * Create payment order
     *
     * @param paymentOrderDTO 支付订单DTO
     * @return 支付订单
     */
    PaymentOrder createOrder(PaymentOrderDTO paymentOrderDTO);

    /**
     * 根据ID获取支付订单
     * Get payment order by ID
     *
     * @param id 支付订单ID
     * @return 支付订单
     */
    PaymentOrder getOrderById(Long id);

    /**
     * 根据订单号获取支付订单
     * Get payment order by order number
     *
     * @param orderNo 订单号
     * @return 支付订单
     */
    PaymentOrder getOrderByOrderNo(String orderNo);

    /**
     * 根据业务订单号获取支付订单
     * Get payment order by business order number
     *
     * @param businessOrderNo 业务订单号
     * @return 支付订单
     */
    PaymentOrder getOrderByBusinessOrderNo(String businessOrderNo);

    /**
     * 根据状态查询支付订单列表
     * List payment orders by status
     *
     * @param status 支付订单状态
     * @return 支付订单列表
     */
    List<PaymentOrder> listOrdersByStatus(String status);

    /**
     * 根据用户ID查询支付订单列表
     * List payment orders by user ID
     *
     * @param userId 用户ID
     * @return 支付订单列表
     */
    List<PaymentOrder> listOrdersByUserId(Long userId);

    /**
     * 关闭支付订单
     * Close payment order
     *
     * @param orderNo 订单号
     * @return 是否成功
     */
    boolean closeOrder(String orderNo);

    /**
     * 更新支付订单状态
     * Update payment order status
     *
     * @param orderNo 订单号
     * @param status  支付订单状态
     * @return 是否成功
     */
    boolean updateOrderStatus(String orderNo, String status);
} 